#pragma once
#include "TypeDefs.h"

class vector2
{
public:
	vector2(void);
	vector2(const vector2 &a);
	vector2(float x, float y);
	vector2(uint x, uint y);
	vector2(int x, int y);
	~vector2(void);
	vector2 operator+(const vector2 &b);
	vector2 operator-(const vector2 &b);
	vector2 operator-();
	vector2 operator*(float a);
	vector2 operator/(float a);
	inline vector2 operator/(vector2 &b) {
		return vector2(x/b.x, y/b.y);
	};
	vector2 Normalize();
	vector2 Negate();
	vector2 Rotate(float zRotation);
	vector2 Translate(float xTrans, float yTrans);
	vector2 Translate(vector2 trans);
	vector2 Scale(float uniScale);
	vector2 Scale(float xScale, float yScale);
	float Length();

	static vector2 Lerp(const vector2 &a, const vector2 &b, float step)
	{
		float sX = a.x + (b.x - a.x) * step;
		float sY = a.y + (b.y - a.y) * step;
		return vector2(sX, sY);
	};

	int IX() { return (int)x; }
	int IY() { return (int)y; }

	float x;
	float y;
};

